{
  "name": "Retail Model Parser - Template",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "value": "1kn-MhxnDobbD4bsAE3KVdzJeDV02HkPI",
          "mode": "list",
          "cachedResultName": "Retail Model Parser",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1kn-MhxnDobbD4bsAE3KVdzJeDV02HkPI"
        },
        "event": "fileCreated",
        "options": {}
      },
      "type": "n8n-nodes-base.googleDriveTrigger",
      "typeVersion": 1,
      "position": [
        -224,
        336
      ],
      "id": "b6f77f70-3ae4-432b-9ad9-b8b1987791c3",
      "name": "Google Drive Trigger",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        240,
        352
      ],
      "id": "8e65ae5f-5bef-4796-ae4d-bcc67754d146",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "analyze",
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "text": "You are an expert appliance technician trained to read appliance model/serial number tags from images.\n\nYour task:\n1. Carefully inspect the image.\n2. Extract ONLY the model number and serial number.\n3. Provide a confidence score (0–100) based on how sure you are that the extraction is correct.\n   - 100 = extremely confident / clear readable tag\n   - 0–50 = uncertain, blurry, partial text, conflicting interpretations\n\nOutput format (must be valid JSON):\n\n{\n  \"model_number\": \"\",\n  \"serial_number\": \"\",\n  \"confidence\": 100\n}\n\nRules:\n- If the image contains multiple numbers, choose the ONE that most closely matches the typical appliance Model (e.g., LREL6321S, WRS315SNHM03, DLEX4000W) and Serial (e.g., KR47A12345).\n- If you cannot find one of the fields, output an empty string (\"\") for that field.\n- Never include explanations. Output only the JSON object.\n",
        "inputType": "binary",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1,
      "position": [
        416,
        352
      ],
      "id": "48d9a2d7-b5e7-445a-b0c6-2781e05add1a",
      "name": "Analyze an image",
      "retryOnFail": true,
      "credentials": {
        "googlePalmApi": {
          "id": "oS5ynprWWhF5Scty",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// Get raw output from Gemini\nlet raw = $json.content?.parts?.[0]?.text || \"\";\n\n// Strip markdown fences if present\nraw = raw\n  .replace(/```json/i, \"\")\n  .replace(/```/g, \"\")\n  .trim();\n\nlet parsed;\n\ntry {\n  parsed = JSON.parse(raw);\n} catch (e) {\n  // If parsing fails, return a structured error\n  return [\n    {\n      json: {\n        success: false,\n        error: \"Failed to parse JSON from Gemini output\",\n        raw_output: raw\n      }\n    }\n  ];\n}\n\n// Extract values safely\nconst model = parsed.model_number || null;\nconst serial = parsed.serial_number || null;\n\n// Convert confidence to number (0–1 or 0–100 supported)\nlet confidence = parsed.confidence || parsed.confidence_score || parsed.confidenceLevel;\n\n// Normalize confidence\nif (typeof confidence === \"string\") {\n  confidence = parseFloat(confidence.replace(\"%\", \"\").trim());\n}\n\nif (confidence > 1) {\n  confidence = confidence / 100; // convert 0–100 → 0–1\n}\n\n// Final output\nreturn [\n  {\n    json: {\n      success: true,\n      model_number: model,\n      serial_number: serial,\n      confidence: confidence ?? null,\n      raw_output: raw\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        752,
        336
      ],
      "id": "022a3c34-8052-4048-9f28-ead9d6f4c247",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1_Oa4cX-SYcYDapw7RCivklOitFre40TAUQpkL2R0rS0",
          "mode": "list",
          "cachedResultName": "Hiecor Inventory Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_Oa4cX-SYcYDapw7RCivklOitFre40TAUQpkL2R0rS0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1426153803,
          "mode": "list",
          "cachedResultName": "Parse Outputs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_Oa4cX-SYcYDapw7RCivklOitFre40TAUQpkL2R0rS0/edit#gid=1426153803"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Serial": "={{ $('Edit Fields1').item.json.serial_number }}",
            "Model": "={{ $('Edit Fields1').item.json.model_number }}",
            "Confidence": "={{ $('Edit Fields1').item.json.confidence }}",
            "Link To Img": "=https://drive.google.com/file/d/{{ $json.id }}"
          },
          "matchingColumns": [
            "Serial"
          ],
          "schema": [
            {
              "id": "S&D",
              "displayName": "S&D",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Model",
              "displayName": "Model",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Serial",
              "displayName": "Serial",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Link To Img",
              "displayName": "Link To Img",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Confidence",
              "displayName": "Confidence",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Serial On Hiecor DB",
              "displayName": "Serial On Hiecor DB",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QTY Serial on Hiecor DB",
              "displayName": "QTY Serial on Hiecor DB",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Model Recorded on Hiecor",
              "displayName": "Model Recorded on Hiecor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Partial Model",
              "displayName": "Partial Model",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Linq S&D Model",
              "displayName": "Linq S&D Model",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Counts on Hiecor",
              "displayName": "Counts on Hiecor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Counts Physical",
              "displayName": "Counts Physical",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Correct Inv",
              "displayName": "Correct Inv",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Verified",
              "displayName": "Verified",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1120,
        -160
      ],
      "id": "e5dbc363-c90f-4403-88ac-d60be682235d",
      "name": "Append or update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "e6ow0ICBmycDSAPC",
          "name": "Google Sheets Greenville"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Edit Fields1').item.json.confidence.toNumber() }}",
                    "rightValue": 0.7,
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "id": "3bf14fc6-7c5b-4408-a43b-7e4ac81db251"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Over 70% Confidence"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "11745ed5-5cd9-4a4f-8225-606c0cd9aca0",
                    "leftValue": "={{ $('Edit Fields1').item.json.confidence.toNumber() }}",
                    "rightValue": 0.69,
                    "operator": {
                      "type": "number",
                      "operation": "lte"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Under 69"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        672,
        -64
      ],
      "id": "95a25b42-2a21-47cf-b0cf-13f4371d525d",
      "name": "Switch1"
    },
    {
      "parameters": {
        "operation": "move",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Google Drive Trigger').item.json.id }}",
          "mode": "id"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "FOLDER_ID",
          "mode": "id"
        }
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        896,
        -160
      ],
      "id": "86cc5b91-076e-465e-bc52-bc8f062ea4a0",
      "name": "Move to Processed",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "operation": "move",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Google Drive Trigger').item.json.id }}",
          "mode": "id"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "FOLDER_ID",
          "mode": "id"
        }
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        896,
        32
      ],
      "id": "8ac70179-1bf3-45c5-8910-edfaf614b314",
      "name": "Move to Failed",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Download file').item.json.id }}",
          "mode": "id"
        },
        "newUpdatedFileName": "={{ $json.Model }} - {{ $json.Serial }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        448,
        -64
      ],
      "id": "90f12c63-482d-4dc3-9672-bd01f89c9aba",
      "name": "Update file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mistral.ai/v1/files",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "purpose",
              "value": "ocr"
            },
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "file",
              "outputPropertyName": "ocr_output.json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        704,
        560
      ],
      "id": "894feae1-ed59-4a83-a749-db48d28d89e4",
      "name": "Upload to Mistral",
      "credentials": {
        "httpHeaderAuth": {
          "id": "3bQNPEHPDMBPB98y",
          "name": "Mistral OCR"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mistral.ai/v1/ocr",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"mistral-ocr-latest\",\n  \"document\": {\n    \"type\": \"image_url\",\n    \"image_url\": \"{{ $json.url }}\"\n  }\n}",
        "options": {}
      },
      "id": "d6a1a499-de4e-4be1-8434-47e7e1ad2a29",
      "name": "Mistral IMAGE OCR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1392,
        560
      ],
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {
          "id": "3bQNPEHPDMBPB98y",
          "name": "Mistral OCR"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        0,
        336
      ],
      "id": "4300bafe-177f-439c-8e8c-756842e6a1dd",
      "name": "Loop Over Items"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1984,
        336
      ],
      "id": "a5dad3d5-c79e-46c4-ba0d-cab4b67ac92b",
      "name": "Wait",
      "webhookId": "02d7673c-3128-44c0-9a2f-a30e30869d37"
    },
    {
      "parameters": {
        "operation": "fromJson",
        "binaryPropertyName": "ocr_output.json",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        896,
        560
      ],
      "id": "82bec5b2-dd33-4899-b9e9-e80b8f4e9a20",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "url": "=https://api.mistral.ai/v1/files/{{ $json.file_id }}/url",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "expiry",
              "value": "24"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1216,
        560
      ],
      "id": "d5c8fd18-aec4-4302-9171-2b7a428df7f3",
      "name": "Get Signed URL",
      "credentials": {
        "httpHeaderAuth": {
          "id": "3bQNPEHPDMBPB98y",
          "name": "Mistral OCR"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "fc5a6283-5a66-4518-85de-77bc1bdbd017",
              "name": "file_id",
              "value": "={{ $json.data.id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1056,
        560
      ],
      "id": "ab49ecfa-e84b-442e-a921-b618f5364965",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an expert appliance model-tag reader with 20+ years of experience identifying model and serial numbers from images of appliance labels, stickers, plates, and rating tags.\n\nYour job is to analyze the image OCR data provided and extract ONLY the model number and serial number, with a confidence score of 1-100.\n\nFollow these rules exactly:\n\nIf the image clearly shows a model number → extract it.\n\nIf it clearly shows a serial number → extract it.\n\nIf a value is partially readable, guess ONLY if confidence is above 75.\n\nIf not readable or uncertain → return an empty string for that field.\n\nConfidence score must be between 1 and 100.\n\nReturn only valid JSON, no text outside the JSON block.\n\nOutput Format (must match exactly):\n\n{\n  \"model_number\": \"\",\n  \"serial_number\": \"\",\n  \"confidence\": 100\n}\n\n\nDo not add any explanation. Do not include text outside the JSON.\n\nHere is the OCR text ouput from the image: {{ $json.pages[0].markdown }}\n\nIf you are able to access the binary data of the image you can use that too to confirm data.",
        "options": {
          "passthroughBinaryImages": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1584,
        560
      ],
      "id": "47534432-03fb-422b-96aa-0a5cc0053ed0",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1568,
        720
      ],
      "id": "7805daf2-7f1e-4db6-9185-f4264ecaf923",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "9d01Yb8z3wRAj5tY",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// 1. Extract the string from the 'output' property\nlet raw = $json[\"output\"];\n\n// 2. Remove Markdown/code formatting (```json ... ```)\nraw = raw.replace(/```json/g, '').replace(/```/g, '').trim();\n\n// 3. Parse the string to a JSON object\nconst data = JSON.parse(raw);\n\n// 4. Output as a new item (so all fields are top-level for mapping)\nreturn [data];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1984,
        560
      ],
      "id": "d1f31e79-e5b3-4969-b901-1d467c750bde",
      "name": "Code"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8fc87bf5-f8b2-4ee5-b058-39714d12fa21",
              "name": "model_number",
              "value": "={{ $('Code in JavaScript').item.json.model_number }}",
              "type": "string"
            },
            {
              "id": "37a9a8a8-4bd6-499d-8107-ba22d6ba0757",
              "name": "serial_number",
              "value": "={{ $('Code in JavaScript').item.json.serial_number }}",
              "type": "string"
            },
            {
              "id": "6f6f4334-8b36-4941-a08d-c38437cf94cf",
              "name": "confidence",
              "value": "={{ $('Code in JavaScript').item.json.confidence }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        224,
        -64
      ],
      "id": "59c01c35-9d2d-48d2-a27a-4addd247b573",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        528,
        560
      ],
      "id": "53900331-6643-411e-abd0-e1a2a76298ab",
      "name": "Download file1",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "sW61u9pxTcqAaX2O",
          "name": "Google Drive Greenville Account"
        }
      }
    },
    {
      "parameters": {
        "content": "## Step 1 \n** Configure the Google Drive Trigger (Image Intake)**\nThis automation starts when a photo is added to a specific folder.\nOpen the Google Drive Trigger node\n\n\nClick Create New Credential and authorize your Google account\n\n\nSelect or create a folder, for example:\n\n /Inventory / Model Tags / Incoming\n\n\nSave the node\n\n\n✅ This folder becomes the drop zone for inventory photos.\n Anyone with access can upload images from their phone.\n",
        "height": 640,
        "width": 384
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -96
      ],
      "typeVersion": 1,
      "id": "8575f952-e6f5-4941-9e2a-0addb75b2e3f",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Step 2\n**Configure Gemini API**\n\nFor assistance visit https://docs.n8n.io/integrations/builtin/credentials/google/",
        "height": 320,
        "width": 256
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        192
      ],
      "typeVersion": 1,
      "id": "7d1c5f2e-5cc0-4fd6-8a06-ba4610b4fe59",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Backup Branch Only\n**Optional** \nThis layer only runs if Gemini fails. \nYou can erase if unable to configure",
        "height": 368,
        "width": 1984,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        544
      ],
      "typeVersion": 1,
      "id": "980d0f0d-ddd4-4be6-902d-68c276f76782",
      "name": "Sticky Note2"
    }
  ],
  "pinData": {
    "Google Drive Trigger": [
      {
        "json": {
          "parents": [
            "1kn-MhxnDobbD4bsAE3KVdzJeDV02HkPI"
          ],
          "lastModifyingUser": {
            "displayName": "Will Toro",
            "kind": "drive#user",
            "me": true,
            "permissionId": "05976684050745393007",
            "emailAddress": "greenville@appliancegm.com",
            "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocJV35CHBTJSwlZRqTLDtOSZqiPLnukOePJ0_z9tIV9vyqV3dQ=s64"
          },
          "owners": [
            {
              "displayName": "Will Toro",
              "kind": "drive#user",
              "me": true,
              "permissionId": "05976684050745393007",
              "emailAddress": "greenville@appliancegm.com",
              "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocJV35CHBTJSwlZRqTLDtOSZqiPLnukOePJ0_z9tIV9vyqV3dQ=s64"
            }
          ],
          "permissions": [
            {
              "kind": "drive#permission",
              "id": "11892491945912001809",
              "type": "user",
              "emailAddress": "hbintgroup6@gmail.com",
              "role": "writer",
              "displayName": "hbintgroup6",
              "photoLink": "https://lh3.googleusercontent.com/a-/ALV-UjWy0-EBxFMLO4Vo1cRRo34xYHVju5C1839zaFkdZJRKXAwawQ=s64",
              "deleted": false,
              "pendingOwner": false
            },
            {
              "kind": "drive#permission",
              "id": "05694661427966089772",
              "type": "user",
              "emailAddress": "jhandal@appliancegm.com",
              "role": "writer",
              "displayName": "Jorge Handal",
              "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocJl-byRYiiPJlr0wfy30_CpZ-ZCchNpKZaRng7iQtxKn_KgHg=s64",
              "deleted": false,
              "pendingOwner": false
            },
            {
              "kind": "drive#permission",
              "id": "05976684050745393007",
              "type": "user",
              "emailAddress": "greenville@appliancegm.com",
              "role": "owner",
              "displayName": "Will Toro",
              "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocJV35CHBTJSwlZRqTLDtOSZqiPLnukOePJ0_z9tIV9vyqV3dQ=s64",
              "deleted": false,
              "pendingOwner": false
            }
          ],
          "spaces": [
            "drive"
          ],
          "capabilities": {
            "canAcceptOwnership": false,
            "canAddChildren": false,
            "canAddMyDriveParent": false,
            "canChangeCopyRequiresWriterPermission": true,
            "canChangeItemDownloadRestriction": true,
            "canChangeSecurityUpdateEnabled": false,
            "canChangeViewersCanCopyContent": true,
            "canComment": true,
            "canCopy": true,
            "canDelete": true,
            "canDisableInheritedPermissions": false,
            "canDownload": true,
            "canEdit": true,
            "canEnableInheritedPermissions": true,
            "canListChildren": false,
            "canModifyContent": true,
            "canModifyContentRestriction": true,
            "canModifyEditorContentRestriction": true,
            "canModifyOwnerContentRestriction": true,
            "canModifyLabels": false,
            "canMoveChildrenWithinDrive": false,
            "canMoveItemIntoTeamDrive": true,
            "canMoveItemOutOfDrive": true,
            "canMoveItemWithinDrive": true,
            "canReadLabels": false,
            "canReadRevisions": true,
            "canRemoveChildren": false,
            "canRemoveContentRestriction": false,
            "canRemoveMyDriveParent": true,
            "canRename": true,
            "canShare": true,
            "canTrash": true,
            "canUntrash": true
          },
          "permissionIds": [
            "11892491945912001809",
            "05694661427966089772",
            "05976684050745393007"
          ],
          "imageMediaMetadata": {
            "location": {
              "latitude": 34.565461111111105,
              "longitude": -82.65542777777779,
              "altitude": 223.30942828485456
            },
            "width": 4032,
            "height": 3024,
            "rotation": 1,
            "time": "2025:11:18 13:26:54",
            "cameraMake": "Apple",
            "cameraModel": "iPhone 17 Pro Max",
            "exposureTime": 0.016666668,
            "aperture": 2.2,
            "flashUsed": false,
            "focalLength": 2.22,
            "isoSpeed": 640,
            "meteringMode": "Pattern",
            "sensor": "One-chip color area",
            "exposureMode": "Auto",
            "whiteBalance": "Auto",
            "exposureBias": 0
          },
          "linkShareMetadata": {
            "securityUpdateEligible": false,
            "securityUpdateEnabled": true
          },
          "downloadRestrictions": {
            "itemDownloadRestriction": {
              "restrictedForReaders": false,
              "restrictedForWriters": false
            },
            "effectiveDownloadRestrictionWithContext": {
              "restrictedForReaders": false,
              "restrictedForWriters": false
            }
          },
          "kind": "drive#file",
          "id": "1c_oGAJJ9MeD929Dc5X21NsBhpvcpwzuR",
          "name": "IMG_3148.JPG",
          "mimeType": "image/jpeg",
          "starred": false,
          "trashed": false,
          "explicitlyTrashed": false,
          "version": "2",
          "webContentLink": "https://drive.google.com/uc?id=1c_oGAJJ9MeD929Dc5X21NsBhpvcpwzuR&export=download",
          "webViewLink": "https://drive.google.com/file/d/1c_oGAJJ9MeD929Dc5X21NsBhpvcpwzuR/view?usp=drivesdk",
          "iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/image/jpeg",
          "hasThumbnail": true,
          "thumbnailLink": "https://lh3.googleusercontent.com/drive-storage/AJQWtBMp3B8V0o0cCGPtzl1d--TQbnWgnl4PlQ5bJq0Y854jRxpw7-LghKN3nK2X3OUcfR7vdqUziZ7472S7DDBucaJu--46sGYvkRNqvzgM5iw9eg=s220",
          "thumbnailVersion": "1",
          "viewedByMe": true,
          "viewedByMeTime": "2025-11-18T21:40:28.759Z",
          "createdTime": "2025-11-18T21:40:28.759Z",
          "modifiedTime": "2025-11-18T21:40:28.759Z",
          "modifiedByMeTime": "2025-11-18T21:40:28.759Z",
          "modifiedByMe": true,
          "shared": true,
          "ownedByMe": true,
          "viewersCanCopyContent": true,
          "copyRequiresWriterPermission": false,
          "writersCanShare": true,
          "originalFilename": "IMG_3148.JPG",
          "fullFileExtension": "JPG",
          "fileExtension": "JPG",
          "md5Checksum": "6ca12a6967bae7dbf84a83a61dd11214",
          "sha1Checksum": "f8bf09ce1097332142bc8d17b93bf219640d451e",
          "sha256Checksum": "f11b71e483ed769ed1349d682692793523b19ed0d33b7163bea4478a3ae8fbbc",
          "size": "2432493",
          "quotaBytesUsed": "2432493",
          "headRevisionId": "0B2GxC80qVN1lTnR2NDJTV1lBNHFqTXRzOE5tNXF5cHF4VTVJPQ",
          "isAppAuthorized": false,
          "inheritedPermissionsDisabled": false
        }
      }
    ],
    "Move to Processed": [
      {
        "json": {
          "kind": "drive#file",
          "id": "1c_oGAJJ9MeD929Dc5X21NsBhpvcpwzuR",
          "name": " - ",
          "mimeType": "image/jpeg"
        }
      }
    ]
  },
  "connections": {
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Analyze an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze an image": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        []
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Move to Processed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Move to Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move to Processed": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update file": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Mistral": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral IMAGE OCR": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Signed URL": {
      "main": [
        [
          {
            "node": "Mistral IMAGE OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Get Signed URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file1": {
      "main": [
        [
          {
            "node": "Upload to Mistral",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "d36996e1-9bac-44d3-8d7b-0435c15bf522",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "992f6b15ce9418f680548f917c88a9daa82a875a56a26e12ae36d126941f6f18"
  },
  "id": "LweDCRqAIeDxMQBs",
  "tags": []
}